<template>
	<sys-container :label="'会员套餐选择'" :withoutTop="true">
		<template v-slot:content>
			<view class="warp">
				<sliderHead style="width: 100%;"></sliderHead>
				<view class="packageList">
					<view class="packType">
						<view class="typeTit">
							中级消防维保
						</view>
						<view class="typeMain">
							<div class="pic" v-for="item in monitorWayList" style="width:100%;height:300rpx;" @tap="jumpToBuy(item)">
								<image :src="item.img" mode="aspectFit" style="width:100%;height:100%"></image>
							</div>
							<!-- <div class="pic" style="width:100%;height:300rpx;background:#abf" @tap="jumpToBuy"></div> -->
							<!-- <image src="" mode=""></image> -->
						</view>
					</view>
					<view class="packType">
						<view class="typeTit">
							中级消防监控
							
						</view>
						<view class="typeMain">
							<div class="pic" v-for="item in maintainingList" style="width:100%;height:300rpx;" @tap="jumpToBuy(item)">
								<image :src="item.img" mode="aspectFit" style="width:100%;height:100%"></image>
							</div>
						</view>
					</view>
				</view>
			
			
				
			</view>
		</template>
	</sys-container>
</template>

<script>
	import { memberShip } from '@/globalApi/requestApi.js'
	import {getLastDay,getLastDayFromNow} from '@/util/index.js'
	import sliderHead from '@/components/sliderHead.vue'
	export default {
		data() {
			return {
				monitorWayList:[],
				maintainingList:[],
				getLastDay,
				
			}
		},
		components:{
			sliderHead
		},
		onShow(){
			this.initData()
		},
		methods: {
			jumpToBuy(data){
				
				uni.navigateTo({
					url:'../package/buyPackage/buyPackage?data='+ JSON.stringify(data)
				})
			},
			initData(){
				memberShip().then(res=>{
					if(res.code==200){
						this.monitorWayList = res.data.filter(item=>{
							return item.cate_type=="消防检测维保方向"
						})
						this.maintainingList = res.data.filter(item=>{
							return item.cate_type=="消防监控方向"
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.warp{
		width:100%;
		min-height:100%;
		display:flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-start;
		background: #F6F6F6;
		
		.packageList{
			width:100%;
			margin-top:40rpx;
			.packType{
				width:100%;
				.typeTit{
					text-align: center;
					font-size: 40rpx;
					font-weight: bold;
					color: #222222;
					margin-bottom: 10rpx;
				}
				.typeMain{
					width:100%;
					padding:0 40rpx;
					box-sizing: border-box;
					.pic{
						margin-bottom:30rpx;
					}
				}
			}
		}
	}
</style>